﻿<%@ Page Title="" Language="C#" MasterPageFile="~/pages/master/WebList.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="BF.Web.pages.XZCF_WS_ZJBCJDSPage.List" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceJs" runat="server">
    <script type="text/javascript">
        //删除
        var titleDelete = "提示";
        var msgDelete = "请选择要删除的记录！";
        var configDelete = "是否确认要删除记录！";
        function Delete() {
            var isDelete = $(":checkbox:checked");
            if (isDelete.length == 0) {
                Ext.MessageBox.show({ title: titleDelete, msg: msgDelete, buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
                Ext.MessageBox.show({
                    title: titleDelete,
                    msg: configDelete,
                    buttons: { yes: '确  定', no: '取 消' },
                    fn: function (result) {
                        if (result == "yes") {
                            __doPostBack("ctl00$ContentPlaceHtml$btnDelete", "");
                        }
                    },
                    icon: 'ext-mb-info'
                });
                return false;
        }

        //弹出新增窗口
        function Add() {
            winer.OpenWin('新增', GetUrl(this) + 'Edit.aspx', 810, 550, false, this);
            return false;
        }

        //弹出查看窗口
        function View(sKey) {
            winer.OpenWin('查看', GetUrl(this) + 'View.aspx?State=View&sID=' + sKey, 775, 550, false, this);
            return false;
        }

        //修改前台方法
        function Update() {
            if ($(":checkbox:checked").length == 0) {
                Ext.MessageBox.show({ title: '提示', msg: '请选择要修改的记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            if ($(":checkbox:checked").length > 1) {//只能选择一项的判断
                Ext.MessageBox.show({ title: '提示', msg: '只能选择一条记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            var values = $(":checkbox:checked").val();

            winer.OpenWin('修改', GetUrl(this) + 'Edit.aspx?sID=' + values, 810, 550, false, this);

            return false;
        }

        //关闭弹出window时，执行的事件
        function Refurbish() {
            __doPostBack('ctl00$ContentPlaceHtml$AspNetPager1', '')
        }

        function MultipleSelect(obj) {
            if (obj.checked) {
                $("#div_scroll_x  :checkbox").attr("checked", true);
            }
            else {
                $("#div_scroll_x :checkbox:checked").each(function () {
                    $(this).attr("checked", false);
                })
            }
        }

        function checkStop(obj) {

            Controlcheck(obj);
        }

        //控制checkbox在单选模式时，只能单选
        function Controlcheck(obj) {
            if (!$("#chxIsMultipleSelect").attr("checked")) {
                if (obj.checked) {
                    $("#div_scroll_x  :checkbox:checked").not(obj).attr("checked", false);
                }
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHtml" runat="server">
    <table id="tabHead" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
        class="listtop1">
        <tr>
            <td id="QueryCondition" style="border-bottom: 1px solid #8db2e3;">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom: 5px;
                    margin-top: 4px;" class="content04 ">
                    <tr>
                        <td align="right">
                            标题：
                        </td>
                        <td>
                            <tll:DataTextBox ID="sTitle" runat="server"
                                Width="138px" MaxLength="50"></tll:DataTextBox>
                        </td>
                        <td align="right">
                            作者：
                        </td>
                        <td>
                            <tll:DataTextBox ID="sAuthor" runat="server" Width="138px" MaxLength="50">
                            </tll:DataTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            发表时间：
                        </td>
                        <td>
                            <tll:DataTextBox ID="dPublishTimeBegin" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>/
                            <tll:DataTextBox ID="dPublishTimeEnd" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>
                        </td>
                        <td align="right">
                            查询范围：
                        </td>
                        <td>
                            <tll:DataDropDownList ID="ddlScope" runat="server">
                                <asp:ListItem Text="所有机构" Value="1"></asp:ListItem>
                                <asp:ListItem Text="本机构" Value="2"></asp:ListItem>
                            </tll:DataDropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table id="" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
                    style="margin-bottom: 2px; margin-top: 2px; height: 26px;">
                    <tr>
                        <td>
                            <div class="btn01">
                                <asp:LinkButton ID="btnQuery" runat="server" OnClientClick="" OnClick="btnQuery_Click">
                            <span>
                                <img alt="" src="http://extjs.com/s.gif" border="0" class="icon icon-magnifier" /><div class="center">
                                    查询</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnAdd" runat="server" OnClientClick="return Add();">
                            <span>
                                <img src="../../../images/table_add.png" alt="" border="0" /><div class="center">
                                    新增</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnUpdate" OnClientClick="return Update();" runat="server">
                                 <span>
                                <img src="../../../images/table_edit.png" alt="" border="0" /><div class="center">
                                    修改</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return Delete();" OnClick="btnDelete_Click">
                            <span>
                                <img src="../../../images/table_delete.png" alt="" border="0" /><div class="center" id="divStop">
                                    删除</div>
                            </span>
                                </asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div id="div_scroll_x" class="div_scroll">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Repeater ID="Repeater1" runat="server">
                    <HeaderTemplate>
                        <table id="tbList" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
                            class="list">
                            <thead>
                                <tr>
                                    <td align="center" style="width: 32px; padding-left: 4px;">
                                        <input id="chxIsMultipleSelect" type="checkbox" value="title" onclick="MultipleSelect(this)" />
                                    </td>
																	<td align="center" style="width: 150px;">
                                        gKey
                                    </td>
																		<td align="center" style="width: 150px;">
                                        gSLLJKey
                                    </td>
																		<td align="center" style="width: 150px;">
                                        iBCFS
                                    </td>
																		<td align="center" style="width: 150px;">
                                        dBCKSSJ
                                    </td>
																		<td align="center" style="width: 150px;">
                                        dBCJSSJ
                                    </td>
																		<td align="center" style="width: 150px;">
                                        sBCDD
                                    </td>
																		<td align="center" style="width: 150px;">
                                        sWPQD
                                    </td>
																		<td align="center" style="width: 150px;">
                                        sDSRQM
                                    </td>
																		<td align="center" style="width: 150px;">
                                        dDSRQMRQ
                                    </td>
																		<td align="center" style="width: 150px;">
                                        sAddUser
                                    </td>
																		<td align="center" style="width: 150px;">
                                        dAddTime
                                    </td>
																		<td align="center" style="width: 150px;">
                                        sEditUser
                                    </td>
																		<td align="center" style="width: 150px;">
                                        dEditTime
                                    </td>
																		<td align="center" style="width: 150px;">
                                        bDel
                                    </td>
																		<td align="center" style="width: 150px;">
                                        EntityState
                                    </td>
																		<td align="center" style="width: 150px;">
                                        EntityKey
                                    </td>
									                                    <td>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="checkbox" name="checkbox1" id="chksuserid" runat="server" value='<%#Eval("gKey")%>' onclick="checkStop(this)" />
                            </td>
                            			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("gKey")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("gSLLJKey")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("iBCFS")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("dBCKSSJ")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("dBCJSSJ")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sBCDD")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sWPQD")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sDSRQM")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("dDSRQMRQ")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sAddUser")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("dAddTime")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sEditUser")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("dEditTime")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("bDel")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("EntityState")%></div>
            </td>
		 			<td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("EntityKey")%></div>
            </td>
		 							<!--<td align="center">
                                <div class="divnr-auto" title='Eval("dPublishTime")==null?"":Eval("dPublishTime","{0:yyyy-MM-dd}")'>
                                    </div>
                            </td>-->
                            <td>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody></table>
                    </FooterTemplate>
                </asp:Repeater>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="AspNetPager1" EventName="PageChanged" />
                <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <div class="div_AspNetPager">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="fengye">
                    <tr>
                        <td>
                            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                                meta:resourcekey="AspNetPager1" PageSize="15">
                            </webdiyer:AspNetPager>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>

